﻿using System.Collections;
using System.Collections.Generic;
using Library.Collections.Generic;

namespace Library.Collections.Specialized
{
    public interface ICollectionTraverseable : IContainer
    {
        bool Add(object item, out ICollectionTraverseable result);
        bool Remove(object item, out ICollectionTraverseable result);
    }

    public interface ICollectionTraverseable<TTraverseable, in TElement> : IContainer<TElement>
        where TTraverseable : ICollectionTraverseable<TTraverseable, TElement>
    {
        bool Add(TElement item, out TTraverseable result);
        bool Remove(TElement item, out TTraverseable result);
    }

    public interface ICollectionTraverseableBulk : ICollectionTraverseable
    {
        bool AddAll(IEnumerable items, out ICollectionTraverseable result);
        bool RemoveAll(IEnumerable items, out ICollectionTraverseable result);
    }

    public interface ICollectionTraverseableBulk<TTraverseable, TElement> : ICollectionTraverseable<TTraverseable, TElement>
        where TTraverseable : ICollectionTraverseableBulk<TTraverseable, TElement>
    {
        bool AddAll(IEnumerable<TElement> items, out TTraverseable result);
        bool RemoveAll(IEnumerable<TElement> items, out TTraverseable result);
    }
}
